/************************************************************
 *This file is part of Searcj_PRJ.
 *
 * This program is free.
 *
 * @file    split.cpp
 * @brief   to split word
 *
 * @author  Dgg
 * @email   1390713385@qq.com
 * @version 0.0.1.0
 * @date    2024/10/11
 * @license GUN General Public License(GPL)
 *
 * ------------------------------------------------
 * Remark   :Description
 * ------------------------------------------------
 * Change History:
 *    <Date>   |    <Version>    |   <Author>   |   <Description>
 * 2024/10/12  |     0.0.1.0     |      Dgg     |     createfile
 * 2024/10/12  |     0.0.1.1     |      Dgg     |     implement splitToolCppJieba::cut
 *
 */
#include "client/create_dict_index/split.h"
#include "cppjieba/Jieba.hpp"
#include <iostream>
#include <vector>
#include <unistd.h>
#include <stdio.h>

using std::string;
using std::vector;

splitTool::splitTool(){}

splitTool::~splitTool(){}

//splitToolCppJieba::splitToolCppJieba(Configuration &conf) : _conf(conf){}

splitToolCppJieba::~splitToolCppJieba(){}

void splitToolCppJieba::cut(const string &sentence, vector<string> &words)
{
    //auto map = _conf.GetConfigMap();

    const char *const DICT_PATH = "./resource/dict/jieba.dict.utf8";
    const char *const HMM_PATH = "./resource/dict/hmm_model.utf8";
    const char *const USER_DICT_PATH = "./resource/dict/user.dict.utf8";
    const char *const IDF_PATH = "./resource/dict/idf.utf8";
    const char *const STOP_WORD_PATH = "./resource/dict/stop_words.utf8";
    cppjieba::Jieba jieba(
        DICT_PATH,
        HMM_PATH,
        USER_DICT_PATH,
        IDF_PATH,
        STOP_WORD_PATH
    );

    jieba.Cut(sentence,words);

    return;
}